home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / GNUST / !GNUst / st / False < prev    next >
Text File  |  1991-09-13  |  2KB  |  105 lines

  1. "======================================================================
  2. |
  3. |   False Method Definitions
  4. |
  5.  ======================================================================"
  6.  
  7.  
  8. "======================================================================
  9. |
  10. | Copyright (C) 1990, 1991 Free Software Foundation, Inc.
  11. | Written by Steve Byrne.
  12. |
  13. | This file is part of GNU Smalltalk.
  14. |
  15. | GNU Smalltalk is free software; you can redistribute it and/or modify it
  16. | under the terms of the GNU General Public License as published by the Free
  17. | Software Foundation; either version 1, or (at your option) any later version.
  18. | GNU Smalltalk is distributed in the hope that it will be useful, but WITHOUT
  19. | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  20. | FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
  21. | details.
  22. | You should have received a copy of the GNU General Public License along with
  23. | GNU Smalltalk; see the file COPYING.  If not, write to the Free Software
  24. | Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  
  25. |
  26.  ======================================================================"
  27.  
  28.  
  29. "
  30. |     Change Log
  31. | ============================================================================
  32. | Author       Date       Change 
  33. | sbb         12 Sep 91      Fixed ifFalse: to evaluate its block.
  34. |
  35. | sbyrne     25 Apr 89      created.
  36. |
  37. "
  38.  
  39. Boolean subclass: #False
  40.     instanceVariableNames: 'truthValue' " ### What's the real ST-80 name? "
  41.     classVariableNames: ''
  42.     poolDictionaries: ''
  43.     category: nil.
  44.  
  45. False comment: 
  46. 'I always tell lies. 
  47. I have a single instance in the system, which represents the value false.' !
  48.  
  49. !False methodsFor: 'basic'!
  50.  
  51. ifTrue: trueBlock ifFalse: falseBlock
  52.     ^falseBlock value
  53. !
  54.  
  55. ifFalse: falseBlock ifTrue: trueBlock
  56.     ^falseBlock value
  57. !
  58.  
  59. ifTrue: trueBlock
  60.     ^nil
  61. !
  62.  
  63. ifFalse: falseBlock
  64.     ^falseBlock value
  65. !
  66.  
  67. not
  68.     ^true
  69. !
  70.  
  71. & aBoolean
  72.     ^false
  73. !
  74.  
  75. | aBoolean
  76.     ^aBoolean
  77. !
  78.  
  79. eqv: aBoolean
  80.     ^aBoolean not
  81. !
  82.  
  83. xor: aBoolean
  84.     ^aBoolean
  85. !
  86.  
  87. and: aBlock
  88.     ^false
  89. !
  90.  
  91. or: aBlock
  92.     ^aBlock value
  93. !!
  94.  
  95.  
  96.  
  97. !False methodsFor: 'printing'!
  98.  
  99. printOn: aStream
  100.     'false' printOn: aStream
  101.  
  102. !!
  103.